package com.heo.music.player.converter;

import com.heo.music.player.dto.output.MusicCommentOutput;
import com.heo.music.player.entity.MusicComment;
import org.modelmapper.ModelMapper;
import org.springframework.stereotype.Component;

@Component
public class MusicCommentConverter extends AbstractConverter<MusicComment, MusicCommentOutput> {

    public MusicCommentConverter(ModelMapper modelMapper) {
        super(modelMapper);
    }

    @Override
    public MusicCommentOutput convert(MusicComment musicComment) {
        MusicCommentOutput output = modelMapper.map(musicComment, MusicCommentOutput.class);
        output.setAuthor(musicComment.getUserInfo().getName());
        return output;
    }
}
